Occurrence of harmful substances in the exhaust gas of an internal combustion engine may be reduced by optimizing the fuel combustion. To optimize the individual combustion steps, the different state parameters of the internal combustion engine must be accurately known. These include in particular the combustion chamber quantities characterizing the combustion process such as, for example, the pressure in the combustion chamber and the temperature in the combustion chamber. These quantities vary over the stroke of the piston of the internal combustion engine as a function of the heat loss properties of the engine and the composition of the gas. The gas properties of air in the combustion chamber vary, for example, due to the admixing of exhaust gas, in particular via exhaust gas recirculation, and/or due to water or water vapor.